<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style media="print">
      .content1 {
        color: green;
        font-size: 18px;
      }
      .content2 {
        display: none;
      }
      #btnPrint {
        display: none;
      }
    </style>
  </head>

  <body>
    <div class="content1">
      <h3>云牧大帅锅</h3>
    </div>
    <div class="content2">
      <h3>云牧小帅锅</h3>
    </div>

    <button id="btnPrint">打印</button>
    <script>
      btnPrint.addEventListener("click", function () {
        window.print();
      });
    </script>
  </body>
</html>
